package com.kelp.codetoolkit.utils

import java.time.LocalDateTime
import java.time.format.DateTimeFormatter


/**
 * @author: liuyuebai
 * @date: 2024/8/3 11:38
 * @description:
 */
object DateTimeUtil {

    fun currentDateTime():String{
        return currentDateTime("yyyy-MM-dd HH:mm:ss")
    }

    fun currentDateTime(format:String):String{
        val dateTime = LocalDateTime.now()
        val dateTimeFormatter = DateTimeFormatter.ofPattern(format)
        return dateTime.format(dateTimeFormatter)
    }
}